package org.shiro.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.shiro.groups.Group;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * base_role
 *
 * @author
 */
@Data
@ApiModel(value = "角色")
public class Role implements Serializable {
  private Long id;

  @ApiModelProperty(value = "角色名称")
  @NotEmpty(message = "角色名称不能为空", groups = Group.addFirstGroup.class)
  @Size(min = 2, max = 10, message = "角色名称字符数介于2~10之间", groups = Group.addSecondGroup.class)
  private String rolename;

  @ApiModelProperty(value = "角色描述")
  private String description;

  private List<Permission> menus = new ArrayList<>();

  private static final long serialVersionUID = 1L;
}
